/*
 * @Description:
 * @version: 1.0.0
 * @Author: YinJianFeng
 * @Date: 2024-03-22 11:02:19
 */

export const Constants = {
  CORE_ENGINE: 'CORE_ENGINE',
  GSP_ENGINE: 'GSP_ENGINE',
};

// 功能按键
export const KEYBOARD_KEY = {
  ENTER: 'Enter',
  ESC: 'Escape',
  TAB: 'Tab',
  SPACE: ' ',
  CTRL: 'Control',
  ALT: 'Alt',
  DELETE: 'Delete',
  SHIFT: 'Shift',
  CONTROL: 'Control',
  ARROWLEFT: 'ArrowLeft',
  ARROWRIGHT: 'ArrowRight',
  ARROWUP: 'ArrowUp',
  ARROWDOWN: 'ArrowDown',
  BACKSPACE: 'Backspace',
  KEY_C: 'c',
  KEY_V: 'v',
  KEY_Y: 'y',
  KEY_Z: 'z',
  KEY_UPPERCASE_C: 'C',
  KEY_UPPERCASE_V: 'V',
  KEY_UPPERCASE_Y: 'Y',
  KEY_UPPERCASE_Z: 'Z',
};

export const WS_EVENTS = {
  WS_LOSE_EVENT: 'WS_LOSW_EVENT',
};
export const preventKeys = ['F5', 'Tab', 'Shift'];

/**
 * @param key 键值
 * @returns boolean，是否输入了数字
 */
export function isNumKey(key: string) {
  return !isNaN(parseInt(key));
}

export const SKETCH_EVENT = {
  SKETCH_EVENT_CHANGE: 'sketch_event_change',
  SKETCH_ENTER_EDIT: 'sketch_enter_edit',
};

export const MARK_EVENT = {
  MARK_PICKED_OBJECT: 'MARK_PICKED_OBJECT',
  MARK_SELECTED: 'MARK_SELECTED',
  MARK_UPDATED: 'MARK_UPDATED',
  MARK_RENDER_CHANGED: 'MARK_RENDER_CHANGED',
  NEW_MARK: 'NEW_MARK',
} as const;

export enum CAD_EVENT {
  SELECT_TREE_OBJECTS = 'selectTreeObjects',
}

export enum PRODUCT_EVENT {
  ASSEMBLY_RENDERED = 'productEvent.AssemblyRendered',
  ASSEMBLY_TREE_CHANGED = 'productEvent.AssemblyTreeChanged',
  ASSEMBLY_TREE_NODE_SELECTED = 'productEvent.AssemblyTreeNodeSelected',
  ASSEMBLY_PRODUCT_EXCHANG = 'productEvent.AssemblyProductExchang',
  REMOVE_DOC = 'productEvent.removeDoc',
  REMOVE_MEASUREMENT = 'productEvent.removeMeasurement',
  PENDING_RENAME_DOC = 'productEvent.pendingRenameDoc',
  PENDING_RESORT_DOC = 'productEvent.pendingResortDoc',
  RENAME_DOC = 'productEvent.renameDoc',
  UPDATE_CONSTRAINTS = 'productEvent.updateConstraints',
  REVERSE_SELECTION = 'productEvent.reverseSelection',
  SMART_MOVING_RENDERED = 'productEvent.smartMovingRendered',
  PARTS_RERENDERED = 'productEvent.rerendered',
}

export enum CAM_EVENT {
  MODEL_LOADED = 'modelLoaded',
}

export const SHAPE_CHANGE_PENDING_EVENT_HANDLED =
  'SHAPE_CHANGE_PENDING_EVENT_HANDLED';

export enum EVENT_CENTER_MANAGER_EVENTS {
  EVENT_CENTER_CHANGING = 'eventCenterChanging',
  EVENT_CENTER_CHANGED = 'eventCenterChanged',
}

export const identityMatrixElements = [
  1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1,
] as const;

export enum COMMON_EVENTS {
  CLICK_NULL = 'clickNull',
  DOCUMENT_INFO_UPDATED = 'documentInfoUpdated',
}

export enum DESIGN_TABLE_EVENTS {
  IMPORT_DESIGN_TABLE = 'IMPORT_DESIGN_TABLE',
  EXPORT_DESIGN_TABLE = 'EXPORT_DESIGN_TABLE',
  SET_DESIGN_TABLE_ID = 'SET_DESIGN_TABLE_ID',
}

export enum LOADING_EVENTS {
  LOADING_CHANGE = 'LOADING_CHANGE',
  LOADING_PROGRESS = 'LOADING_PROGRESS',
}

export enum CIRCLE_BAR_EVENTS {
  CIRCLE_BAR_SHOW = 'CIRCLE_BAR_SHOW',
  CIRCLE_BAR_HIDE = 'CIRCLE_BAR_HIDE',
}

export enum DIM_EVENTS {
  DIM_CSS_2D_INPUT_FOCUS = 'DIM_CSS_2D_INPUT_FOCUS',
}
